/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Random;
//java.util.Date java.util.Calendar java.util.Random

/**
 * <p>Project: jse2204 - Random1
 * <p>Powered by webrx On 2022-08-31 16:26:10
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Random1 {
    public static void main(String[] args) {

        //Math.random() 返回随机小数大于0小于1 double
        System.out.println(Math.random());
        System.out.println(Math.random());
        System.out.println(Math.random());
        System.out.println(Math.random());
        System.out.println(Math.random());

        System.out.println(Math.random() > .5 ? "yes" : "no");

        Random rand = new Random();
        System.out.println(rand.nextDouble());
        System.out.println(rand.nextDouble());
        System.out.println(rand.nextDouble());
        System.out.println(rand.nextDouble());
        System.out.println(rand.nextDouble());

        System.out.println(rand.nextInt());
        //0 - 9 10随机整数
        System.out.println(rand.nextInt(10));
    }
}
